package com.cloud.mall.pms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.pms.out.PmsProductAttributeCategoryOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "商品属性分类管理")
@RequestMapping("/productAttribute/category")
public interface PmsProductAttributeCategoryService {

    @ApiOperation("添加商品属性分类")
    @PostMapping("/create")
    BaseResponse create(@RequestParam String name);
    @ApiOperation("删除单个商品属性分类")
    @PostMapping("/delete/{id}")
    BaseResponse delete(@PathVariable("id") Long id);
    @ApiOperation("修改商品属性分类")
    @PostMapping("/update/{id}")
    BaseResponse update(@PathVariable Long id, @RequestParam String name);
    @ApiOperation(value = "分页获取所有商品属性分类")
    @GetMapping("/list")
    BaseResponse<CommonPage<PmsProductAttributeCategoryOut>> getList(@RequestParam(defaultValue = "5") Integer pageSize, @RequestParam(defaultValue = "1") Integer pageNum);
    @ApiOperation(value = "获取单个商品属性分类信息")
    @GetMapping("/{id")
    BaseResponse<PmsProductAttributeCategoryOut> getItem(@PathVariable("id") Long id);
    @ApiOperation("获取所有商品属性分类及其下属性")
    @GetMapping("/list/withAttr")
    BaseResponse<List<PmsProductAttributeCategoryOut>> getListWithAttr();


}
